Skip to content

Knowledge beta improvements #2545

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2025
Merged

Conversation

kensave
Copy link
Contributor

@kensave kensave commented Aug 11, 2025

Pattern Filtering System (TI-3)

CLI Integration: Added --include and --exclude flags to /knowledge add command
Pattern Filter Module: New pattern_filter.rs with comprehensive glob-style pattern matching
Async File Processing: Enhanced file_processor.rs with async pattern filtering capabilities

Minor fixes (TI-2)

Rename from contexts from knowledge bases: Changed the semantic on how we refer to the knowledge entries.
• **"Are you sure?" : Changed confirmation message
• *Increased amount of extensions supported: Added more text extensions to list of supported files.

Move to right path for knowledge (TI-1)

Automatic migration and new path for knowledge bases: Now they will live in ./aws/amazonq/knowledge_bases

Database Settings Integration (TI-5)

Settings Schema: Added new settings for KnowledgeChunkSize, KnowledgeChunkOverlap, KnowledgeMaxFiles, KnowledgeDefaultIncludePatterns, KnowledgeDefaultExcludePatterns
Helper Method: Added get_int_or() utility method for cleaner database settings access
Configuration Integration: Knowledge store now reads chunk size, overlap, and file limits from database settings

🔧 API Improvements

Clean POJO-Based API

New Request Structure: Replaced messy method overloads with AddContextRequest POJO
Removed Deprecated Methods: Eliminated add_context_from_path() and add_context_from_path_with_patterns()
Single Clean Method: New add_context(AddContextRequest) method handles all scenarios
Better Naming: Renamed IndexingParams to AddContextRequest for external-facing API

Code Organization

Extracted Migration Logic: Moved legacy knowledge base migration code to separate method
Removed Verbose Patterns: Eliminated repetitive get_int().map_or() database access patterns
Cleaner Error Handling: Improved error messages and validation throughout

🎨 User Experience Improvements

CLI Enhancements

Better Styling: Changed add operation from green OperationResult::Success to neutral OperationResult::Info
Improved Messages: Enhanced feedback messages with pattern filtering information
Consistent Behavior: Both add and update operations now use consistent styling

Pattern Filtering UX

Flexible Options: Support for include-only, exclude-only, or combined filtering
Clear Feedback: Operations show which patterns are applied
Database Defaults: Automatic loading of default patterns from database settings

API Consistency

Method Signatures: Standardized all context operations to use structured request objects
Error Handling: Consistent error types and messages across all operations
Type Safety: Proper type definitions for all public API structures

📚 Documentation Updates

README Overhaul

Async API Examples: Updated all code examples to use new async AddContextRequest API
Pattern Filtering Guide: Comprehensive documentation with glob syntax and examples
Feature Updates: Added pattern filtering and database settings to features list
Removed Outdated Info: Eliminated references to deprecated sync API methods

Copy link
Contributor

@brandonskiser brandonskiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/knowledge cancel actually cancels all ongoing operations, not just the most recent
Screenshot 2025-08-11 at 3 34 21 PM

An error using --include syntax seems to stall the operation
Screenshot 2025-08-11 at 4 01 58 PM

@kensave kensave force-pushed the knowledge_beta_improvements branch 2 times, most recently from f32f98c to b55cf79 Compare August 13, 2025 00:55
… (TI-3, TI-5)

- Add pattern filtering foundation with --include/--exclude CLI flags (TI-3)
- Implement knowledge settings integration with database system (TI-5)
- Add comprehensive pattern filter module with glob-style support
- Enhance file processor with async pattern filtering capabilities
- Add extensive test coverage for pattern filtering functionality
- Update knowledge CLI with improved error handling and validation
- Add settings support for chunk size, overlap, and file limits
@kensave kensave force-pushed the knowledge_beta_improvements branch from b55cf79 to 2e1d733 Compare August 13, 2025 00:56
@kensave kensave merged commit e25efa8 into aws:main Aug 13, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants